<template>
  <div class="container">
  加载中···
  </div>
</template>

<script>
import { mapState, mapActions, mapMutations } from 'vuex'
import { getMemberInfo } from '../../api/member'
import { Indicator } from 'mint-ui';
export default {
  name: 'JumpIndex',
  data () {
    return {
      user: {},
      token: '',
      url: '',
      beiyong: '48de7baa3aff445bd60f087452449a03'
    }
  },
  components: {
  },
  created: function () {
    Indicator.open();
    this.token = this.$route.query.token
    this.url = this.$route.query.url
    this.saveToken({ token: this.token })
    getMemberInfo().then(
      response => {
        if (response && response.result.member_info) {
          this.saveAuthInfo({ token: this.token, info: response.result.member_info })
            if(this.url){
                window.location.href = decodeURIComponent(this.url)
            }
        }
        Indicator.close();
      },
      error => {
        Indicator.close();
      }
    )
  },
  computed: {
    ...mapState({
      isOnline: state => state.member.isOnline,
      config: state => state.config.config
    })
  },
  methods: {
    ...mapMutations({
      saveToken: 'memberToken',
      saveAuthInfo: 'memberLogin'
    }),
    ...mapActions({
      fetchConfig: 'fetchConfig'
    }),
    showLogin () {
      this.$router.push({ name: 'HomeMemberLogin' })
    },
  }
}
</script>

<style scoped lang="scss">
.container{
    text-align: center;
    font-size: .7rem;
    font-weight: bold;
    margin-top: 20px;
}
</style>
